package top.btcmarket;

import java.util.Date;
import java.util.concurrent.TimeUnit;

public class TestDate {

	public static void main(String[]args) throws InterruptedException{
		  /*String str="";
		  long starTime=System.currentTimeMillis();
		  //计算循环10000的时间
		  for(int i=0;i<10000;i++){
		   str=str+i;
		  }
		  long endTime=System.currentTimeMillis();
		  long Time=endTime-starTime;
		  System.out.println(Time);
		  StringBuilder bulider=new StringBuilder("");
		  starTime=System.currentTimeMillis();
		  for(int j=0;j<10000;j++){
		   bulider.append(j);
		  }
		  endTime=System.currentTimeMillis();
		  Time=endTime-starTime;
		  System.out.println(Time);*/
		
		/*long starTime=System.currentTimeMillis();
		TimeUnit.SECONDS.sleep(3);
		String str="";
		 for(int i=0;i<10000;i++){
			   str=str+i;
			  }
		long endTime=System.currentTimeMillis();
		
		System.out.println(getDatePoor(endTime,starTime));*/
		
		Long min = 1L;
		Long sec = 61L;
		Long nsec = 17695L;
		
		System.out.println(min+sec/60);
		System.out.println(sec%60+nsec/1000);
		System.out.println(nsec%1000);
		
		
	}
	
	
	public static String getDatePoor(Date endDate, Date nowDate) {
		 
	    long nd = 1000 * 24 * 60 * 60;
	    long nh = 1000 * 60 * 60;
	    long nm = 1000 * 60;
	    // long ns = 1000;
	    // 获得两个时间的毫秒时间差异
	    long diff = endDate.getTime() - nowDate.getTime();
	    // 计算差多少天
	    long day = diff / nd;
	    // 计算差多少小时
	    long hour = diff % nd / nh;
	    // 计算差多少分钟
	    long min = diff % nd % nh / nm;
	    // 计算差多少秒//输出结果
	    // long sec = diff % nd % nh % nm / ns;
	    return day + "天" + hour + "小时" + min + "分钟";
	}
	
	public static String getDatePoor(long endDate, long startTime) {
		 
	    long nd = 1000 * 24 * 60 * 60;
	    long nh = 1000 * 60 * 60;
	    long nm = 1000 * 60;
	    long ns = 1000;
	    // 获得两个时间的毫秒时间差异
	    long diff = endDate - startTime;
	    // 计算差多少天
	    long day = diff / nd;
	    // 计算差多少小时
	    long hour = diff % nd / nh;
	    // 计算差多少分钟
	    long min = diff % nd % nh / nm;
	    // 计算差多少秒//输出结果
	    long sec = diff % nd % nh % nm / ns;
	    
	    long nsec = diff % nd % nh % nm % ns ;
	    
	    
	    return day + "天" + hour + "小时" + min + "分钟"+sec+"秒"+nsec+"毫秒";
	    
	}
}
